Chinese arguments are corrupted by native image on Windows#13359
Chinese arguments are corrupted by native image on Windows#13359JaroslavTulach wants to merge 2 commits intooracle:masterfrom
Conversation
|
Thank you for signing the OCA. |
| List<String> lines = proc.inputReader().lines().toList(); | ||
| assert lines.size() == 1 : "Assuming one line " + lines; | ||
| // System.err.println("got: " + lines.get(0)); | ||
| assert lines.get(0).equals("[" + t1 + ", " + t2 + ", " + t3 + "]"); |
There was a problem hiding this comment.
Running on my (VirtualBox) Windows I get:
PS C:\graal\substratevm> mx --java-home \labsjdk-ce-25.0.2-jvmci-b01\ hellomodule
...
Exception in thread "main" java.lang.AssertionError
at moduletests.hello.app/hello.Main.testPassingArguments(Main.java:183)
at moduletests.hello.app/hello.Main.main(Main.java:71)
at java.base@25.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Command 'C:\\graal\\substratevm\\svmbuild\\hellomodule\moduletests.hello.app' returned non-zero exit status 1.
E.g. looks like we have a reproducer! Also running just the app itself shows the same problem:
graal\substratevm> .\svmbuild\hellomodule\moduletests.hello.app.exe print 使 用 者
[]
e.g. these non-ASCII arguments aren't even passed to the app
- they are not counted as arguments.
- This all exhibits the same problems we had to solve in
- Support for Chinese Characters enso-org/enso#14934
- e.g. by using
GetCommandLineWfunction instead ofGetCommandLineA
There was a problem hiding this comment.
A sample fix is provided in 143d664, but I understand it is not properly placed. The code seems to deal with isolates & co. and I need some guidance to make sure these GetCommandLineW arguments are only read when appropriate. CCing @wirthi
However with the 143d664 fix we certainly propagate the chines arguments to the above program:
PS graal\substratevm> [Console]::OutputEncoding = [System.Text.Encoding]::Unicode;
PS graal\substratevm> .\svmbuild\hellomodule\moduletests.hello.app.exe print 使用 者
[使用, 者]
e.g. the fix isn't "completely off".
|
Thanks for the contribution and for working on this fix. I noticed this PR targets the release/graal-vm/25.0 branch, is there any particular reason to not merge into master? |
143d664 to
bfab13a
Compare
|
Thank you for signing the OCA. |
|
Summary
Related Issues
Testing
Documentation
Contributor Checklist